<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8" import="pojo.*,base.*,service.*,java.text.*,java.util.*"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script type="text/javascript" src="jquery/jquery-1.6.1.js"></script>
<script type="text/javascript" src="jquery/jquery.validate.min.js"></script>
<script> 
$(function(){
$("#Id").focus();
});
		function add() {
			var pic=$("#Pic").val();
			if(pic==""){
			alert("请上传图片");
			return;
			}
			
		$("#form1").submit();
}
 $(document).keydown(function(event){ 
    		 if(event.keyCode == 13) 
    		 {
    			add();
        	}
});
</script>
<script type="text/javascript">
$(function(){

	$("#upload").click(function(){
		$.ajax({
		
			type:"get",
			dataType:"json",
			url:"action/upload.jsp",
			success:function(data){
			if(data.success){
				$("#pic").val(data.path);
			}				
			}
		
		});

	})
	
})



</script>

<style type="text/css">

#box{
	border: 5px groove #CDC9C9;
	height: 500px;
	width: 500px;
	margin-left:auto;
	margin-right:auto;
}
#b1{
	height: 50px;
	width: 510px;
	margin-top: 35px;
}

#s{
   height:40px;
   width:490px;
   margin-bottom:5px;
   }
  body{
	margin:0;
	padding:20px;
	background-image:url("images/innerBJ.jpg");
	background-repeat:no-repeat;
	font:80% Arial, Helvetica, sans-serif;
	color:#555;
	line-height:100%;
}  
</style>
<script type="text/javascript" src="jquery/jquery-1.6.1.js"></script>
<script type="text/javascript" src="jquery/jquery.validate.min.js"></script>
<script type="text/javascript"></script>
</head>


<body >
<% request.setCharacterEncoding("UTF-8"); %>
	
<form id=form1" action="action/addPicAction.jsp" method="post">
		<div id="box" >
			  <p class="STYLE2"> 图片主题
			    <input type="text" name="Topic" id="Topic"/>
			  </p>
			  <p class="STYLE2"> 图片介绍
		           <textarea name="Detail" id="Detail"></textarea>         
			  </p>
			  <p class="STYLE2"> 上传图片
			    <input type="text" name="Picture" id="pic"/>&nbsp;&nbsp;&nbsp;&nbsp;<a style="text-decoration:none;" href="javascript:;" id="upload">上传</a>
			  </p>
			  <br />
			
			   <p align="center">
               <input type="submit" name="Submit" value="提交" onclick="add();"/>&nbsp;&nbsp;&nbsp;&nbsp;<input type="reset" name="reset" value="重置">
                </p>
			  
			</div>
		
		</form>
		
		
	
</body>
</html>
